package com.das.mechanic_base.bean.maintain;


import android.os.Parcel;
import android.os.Parcelable;

public class MainTainPlanBean implements Parcelable {

    public Integer lastReplaceKm;
    public Integer lastReplaceTime;
    public long recommendedCycleKm;
    public long recommendedCycleTime;
    public String serviceBaseName;
    public String serviceBaseSn;
    public String url;

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this.lastReplaceKm);
        dest.writeValue(this.lastReplaceTime);
        dest.writeLong(this.recommendedCycleKm);
        dest.writeLong(this.recommendedCycleTime);
        dest.writeString(this.serviceBaseName);
        dest.writeString(this.serviceBaseSn);
        dest.writeString(this.url);
    }

    public void readFromParcel(Parcel source) {
        this.lastReplaceKm = (Integer) source.readValue(Integer.class.getClassLoader());
        this.lastReplaceTime = (Integer) source.readValue(Integer.class.getClassLoader());
        this.recommendedCycleKm = source.readLong();
        this.recommendedCycleTime = source.readLong();
        this.serviceBaseName = source.readString();
        this.serviceBaseSn = source.readString();
        this.url = source.readString();
    }

    public MainTainPlanBean() {
    }

    protected MainTainPlanBean(Parcel in) {
        this.lastReplaceKm = (Integer) in.readValue(Integer.class.getClassLoader());
        this.lastReplaceTime = (Integer) in.readValue(Integer.class.getClassLoader());
        this.recommendedCycleKm = in.readLong();
        this.recommendedCycleTime = in.readLong();
        this.serviceBaseName = in.readString();
        this.serviceBaseSn = in.readString();
        this.url = in.readString();
    }

    public static final Creator<MainTainPlanBean> CREATOR = new Creator<MainTainPlanBean>() {
        @Override
        public MainTainPlanBean createFromParcel(Parcel source) {
            return new MainTainPlanBean(source);
        }

        @Override
        public MainTainPlanBean[] newArray(int size) {
            return new MainTainPlanBean[size];
        }
    };
}
